Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid crashes on unknown keys #29

Merged
merged 2 commits into from
Apr 8, 2021
Merged

fix: avoid crashes on unknown keys #29

merged 2 commits into from
Apr 8, 2021

Conversation

radeksimko
Copy link
Member

@radeksimko radeksimko commented Mar 26, 2021

@radeksimko radeksimko requested a review from a team March 26, 2021 16:13
@@ -125,7 +125,7 @@ func nestedSymbolsForExpr(expr hcl.Expression) []Symbol {
case *hclsyntax.ObjectConsExpr:
for _, item := range e.Items {
key, _ := item.KeyExpr.Value(nil)
if key.IsNull() || key.Type() != cty.String {
if key.IsNull() || !key.IsWhollyKnown() || key.Type() != cty.String {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual fix, other code is just tests and refactoring for consistency.

Copy link

@aeschright aeschright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants